 #@layout()
 #define content()

<span class="layui-breadcrumb">
  <a href="/">首页</a>
  <a href="/admin/user"><cite>日志管理</cite></a>
</span>

<hr>


<div class="layui-field-box">
<form class="layui-form" action="/admin/user">
    <div class="layui-form-item">
    		<div class="layui-inline">
	      <label class="layui-form-label">用户名</label>
	      <div class="layui-input-inline">
	        <input type="text" name="phone" autocomplete="off" class="layui-input">
	      </div>
	    </div>
	    
	    <div class="layui-inline">
	      <label class="layui-form-label">姓名</label>
	      <div class="layui-input-inline">
	        <input type="text" name="email" autocomplete="off" class="layui-input">
	      </div>
	    </div>
	    
	    <div class="layui-inline">
	      <label class="layui-form-label">邮箱</label>
	      <div class="layui-input-inline">
	        <input type="text" name="email" autocomplete="off" class="layui-input">
	      </div>
	    </div>
	    
	    <div class="layui-inline">
	      <label class="layui-form-label">手机号</label>
	      <div class="layui-input-inline">
	        <input type="text" name="email" autocomplete="off" class="layui-input">
	      </div>
	    </div>
	    
	    <div class="layui-inline">
	      <label class="layui-form-label">状态</label>
	      <div class="layui-input-inline">
	      		#set(SEX_MAP={})
	      		#set(SEX_MAP["dicTypeCode"]="SEX")
	      		#set(SEX_MAP["name"]="status")
	      	   	#set(SEX_MAP["id"]="status")
	        	   	#@dic_get_select(SEX_MAP)
	      </div>
	    </div>
	    
	    <button class="layui-btn" type="button" id="btnSearch">搜索</button>
	    <button class="layui-btn layui-btn-normal" type="reset" >重置</button>
	    <a class="layui-btn layui-btn-danger" href="/admin/user/add" >新增</a>
	    
	</div>
</form>	    
</div>
  
<table class="layui-table" lay-size="sm" lay-data="{height:'auto', url:'/admin/log/pagequery', page:true, id:'dataTable'}" lay-filter="dataTable">
  <thead>
    <tr>
      <th lay-data="{field:'username', width:'80'}">操作人</th>
      <th lay-data="{field:'email', width:'140'}">操作人邮箱</th>
      <th lay-data="{field:'cellphone', width:'110'}">操作人手机号</th>
      <th lay-data="{field:'createTime', width:'110', sort: true}">创建时间</th>
      <th lay-data="{field:'startTime', width:'110', sort: true}">开始时间</th>
      <th lay-data="{field:'endTime', width:'110', sort: true}">结束时间</th>
      <th lay-data="{field:'actionTime', width:'100', sort: true}">用时(毫秒)</th>
      <th lay-data="{field:'method', width:'80', sort: true}">Method</th>
      <th lay-data="{field:'ip', width:'80', sort: true}">IP</th>
      <th lay-data="{field:'auth', width:'100', sort: true}">是否授权</th>
      <th lay-data="{field:'module', width:'80', sort: true}">模块</th>
      <th lay-data="{field:'url', width:'100', sort: true}">URL</th>
      <th lay-data="{field:'referer', width:'100', sort: true}">referer</th>
    </tr>
  </thead>
</table>
<script type="text/html" id="titleTpl">
  	<a href="javascript:doDetail('{{d.id}}');" class="layui-table-link" actionType="detail" actionId="{{d.id}}">详情</a>
  	<a href="javascript:doStartUsing('{{d.id}}');" class="layui-table-link" >启用</a>
  	<a href="javascript:doForbidden('{{d.id}}');" class="layui-table-link" >禁用</a>
	
	#auth(session,'user')
		<a href="javascript:doDelete('{{d.id}}');" class="layui-table-link">删除</a>
	#end
</script>

#end

#define js()

<script>

function doDetail(id){
	window.location.href="/admin/user/view?id="+id;
}

function doStartUsing(id){
	layui.layer.confirm('确认启用么?', function(index){
		$.ajax({
			type:'get',
			url:'/admin/user/startUsing',
			data:'id='+id,
			success:function(data){
				layui.table.reload('dataTable');
			}
		});
		layui.layer.close(index);
	}); 
}

function doForbidden(id){
	layui.layer.confirm('确认禁用么?', function(index){
		$.ajax({
			type:'get',
			url:'/admin/user/forbidden',
			data:'id='+id,
			success:function(data){
				layui.table.reload('dataTable');
			}
		});
		layui.layer.close(index);
	}); 
}

function doDelete(id){
	layui.layer.confirm('确认删除么?', function(index){
		$.ajax({
			type:'get',
			url:'/admin/user/delete',
			data:'id='+id,
			success:function(data){
				layui.table.reload('dataTable');
			}
		});
		layui.layer.close(index);
	}); 
}

</script>

#end


